﻿<%@ Page Language="C#" Culture="auto" UICulture="auto" MasterPageFile="~/MasterPages/ManagementMaster.master"
  AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="MONTRASEC_test.Management.Register"
  Title="Registration Page" %>

<!-- #include virtual="~/Multilingual.inc.aspx" -->
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
  <div id="main">
    <div style="float: left;">
      <h1>
        MONTRASEC Registration Section</h1>
      <p>
        <asp:SqlDataSource ID="sdsUser" runat="server" ConnectionString="<%$ ConnectionStrings:montrasecConnectionString %>"
          InsertCommand="INSERT INTO [USER_] ([USER_USER_FIRSTNAME], [USER_USER_LASTNAME], [USER_USER_COUNTRY], [USER_USER_LEVEL], [USER_USERNAME]) VALUES (@USER_USER_FIRSTNAME, @USER_USER_LASTNAME, @USER_USER_COUNTRY, @USER_USER_LEVEL, @USER_USERNAME)"
          SelectCommand="SELECT * FROM [USER_]" DeleteCommand="DELETE FROM [USER_] WHERE [USER_USERNAME] = @USER_USERNAME"
          UpdateCommand="UPDATE [USER_] SET [USER_USER_FIRSTNAME] = @USER_USER_FIRSTNAME, [USER_USER_LASTNAME] = @USER_USER_LASTNAME, [USER_USER_COUNTRY] = @USER_USER_COUNTRY, [USER_USER_LEVEL] = @USER_USER_LEVEL WHERE [USER_USERNAME] = @USER_USERNAME">
          <DeleteParameters>
            <asp:Parameter Name="USER_USERNAME" Type="String" />
          </DeleteParameters>
          <UpdateParameters>
            <asp:Parameter Name="USER_USER_FIRSTNAME" Type="String" />
            <asp:Parameter Name="USER_USER_LASTNAME" Type="String" />
            <asp:Parameter Name="USER_USER_COUNTRY" Type="String" />
            <asp:Parameter Name="USER_USER_LEVEL" Type="String" />
            <asp:Parameter Name="USER_USERNAME" Type="String" />
          </UpdateParameters>
          <InsertParameters>
            <asp:Parameter Name="USER_USER_FIRSTNAME" Type="String" />
            <asp:Parameter Name="USER_USER_LASTNAME" Type="String" />
            <asp:Parameter Name="USER_USER_COUNTRY" Type="String" />
            <asp:Parameter Name="USER_USER_LEVEL" Type="String" />
            <asp:Parameter Name="USER_USERNAME" Type="String" />
          </InsertParameters>
        </asp:SqlDataSource>
        <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" ContinueDestinationPageUrl="~/Default.aspx"
          OnCreatedUser="CreateUserWizard1_CreatedUser">
          <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
              <ContentTemplate>
                <table border="0">
                  <tr>
                    <td align="center" colspan="2">
                      Sign Up for Your New Account
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User 
                      Name:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                        ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                        ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                        ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                        ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security 
                      Question:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                        ErrorMessage="Security question is required." ToolTip="Security question is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security 
                      Answer:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                        ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="lbFirstname" runat="server" AssociatedControlID="tbUserFirstname">Firstname:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="tbUserFirstname" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbUserFirstname"
                        ErrorMessage="User Firstname is required." ToolTip="User Firstname is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="lbUserLastname" runat="server" AssociatedControlID="tbUserLastname">Lastname:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="tbUserLastname" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tbUserLastname"
                        ErrorMessage="User Lastname is required." ToolTip="User Lastname is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="Label1" runat="server" AssociatedControlID="tbUserLastname">User Level/Role:</asp:Label>
                    </td>
                    <td>
                      <asp:Repeater ID="UsersRoleList" runat="server">
                        <ItemTemplate>
                          <asp:CheckBox runat="server" ID="RoleCheckBox" AutoPostBack="true" Text='<%# Container.DataItem %>' />
                          <br />
                        </ItemTemplate>
                      </asp:Repeater>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                      <asp:Label ID="lbUserCountry" runat="server" AssociatedControlID="tbUserCountry">User Country:</asp:Label>
                    </td>
                    <td>
                      <asp:TextBox ID="tbUserCountry" runat="server"></asp:TextBox>
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbUserCountry"
                        ErrorMessage="User Country is required." ToolTip="User Country is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="center" colspan="2">
                      <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                        ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                    </td>
                  </tr>
                  <tr>
                    <td align="center" colspan="2" style="color: Red;">
                      <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                    </td>
                  </tr>
                </table>
              </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
            </asp:CompleteWizardStep>
          </WizardSteps>
        </asp:CreateUserWizard>
      </p>
    </div>
  </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpNavigation" runat="server">
  <ul class="clearfix">
    <li>
      <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Home</asp:HyperLink>
    </li>
  </ul>
</asp:Content>
